<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>博客</title><meta name="author" content="小魂"><meta name="copyright" content="小魂"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta property="og:type" content="website">
<meta property="og:title" content="博客">
<meta property="og:url" content="https://shark-yun.gitee.io/blog/page/2/index.html">
<meta property="og:site_name" content="博客">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://shark-yun.gitee.io/blog/img/style/touxiang.jpg">
<meta property="article:author" content="小魂">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://shark-yun.gitee.io/blog/img/style/touxiang.jpg"><link rel="shortcut icon" href="/blog/img/favicon.png"><link rel="canonical" href="https://shark-yun.gitee.io/blog/page/2/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/blog/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/blog/',
  algolia: undefined,
  localSearch: undefined,
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    jQuery: 'https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js',
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/js/jquery.justifiedGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/css/justifiedGallery.min.css'
    },
    fancybox: {
      js: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js',
      css: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isanchor: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = { 
  isPost: false,
  isHome: true,
  isHighlightShrink: false,
  isToc: false,
  postUpdate: '2021-04-21 13:41:10'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    })(window)</script><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome/css/font-awesome.min.css"> <script src="/blog/live2d-widget/autoload.js"></script><meta name="generator" content="Hexo 5.4.0"></head><body><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="author-avatar"><img class="avatar-img" src="/blog/img/style/touxiang.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data"><div class="data-item is-center"><div class="data-item-link"><a href="/blog/archives/"><div class="headline">文章</div><div class="length-num">26</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/blog/tags/"><div class="headline">标签</div><div class="length-num">14</div></a></div></div></div><hr/></div></div><div class="page" id="body-wrap"><header class="full_page" id="page-header" style="background-image: url('/blog/img/style/background.png')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/blog/">博客</a></span><div id="menus"><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="site-info"><h1 id="site-title">博客</h1><div id="site_social_icons"><a class="social-icon" href="https://gitee.com/shangxiaohun/dashboard/projects" target="_blank" title="Github"><i class="fa fa-github"></i></a></div></div><div id="scroll-down"><i class="fas fa-angle-down scroll-down-effects"></i></div></header><main class="layout" id="content-inner"><div class="recent-posts" id="recent-posts"><div class="recent-post-item"><div class="post_cover left_radius"><a href="/blog/2020/06/09/%E5%A6%82%E4%BD%95%E4%BC%98%E9%9B%85%E7%9A%84%E5%86%99%E5%87%BApython%E4%BB%A3%E7%A0%81/%E5%A6%82%E4%BD%95%E4%BC%98%E9%9B%85%E7%9A%84%E5%86%99%E5%87%BApython%E4%BB%A3%E7%A0%81/" title="如何优雅的写出python代码">     <img class="post_bg" src="/blog/img/%E5%A6%82%E4%BD%95%E4%BC%98%E9%9B%85%E7%9A%84%E5%86%99%E5%87%BApython%E4%BB%A3%E7%A0%81/%E5%A6%82%E4%BD%95%E4%BC%98%E9%9B%85%E7%9A%84%E5%86%99%E5%87%BApython%E4%BB%A3%E7%A0%81/index.png" onerror="this.onerror=null;this.src='/blog/img/404.jpg'" alt="如何优雅的写出python代码"></a></div><div class="recent-post-info"><a class="article-title" href="/blog/2020/06/09/%E5%A6%82%E4%BD%95%E4%BC%98%E9%9B%85%E7%9A%84%E5%86%99%E5%87%BApython%E4%BB%A3%E7%A0%81/%E5%A6%82%E4%BD%95%E4%BC%98%E9%9B%85%E7%9A%84%E5%86%99%E5%87%BApython%E4%BB%A3%E7%A0%81/" title="如何优雅的写出python代码">如何优雅的写出python代码</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-06-09T13:15:50.000Z" title="发表于 2020-06-09 21:15:50">2020-06-09</time></span></div><div class="content">1如何优美的书写python代码

变量值的交换1a, b &#x3D; b, a

列表推导式
列表推导式是java及C++等语言没有的特性，能够很简洁的实现for循环，可以应用列表，集合或者子字典。例如我们要求20以内的整除3的数的平方的列表，可以用如下代码实现：

1234numbers &#x3D; []for x in xrange(20):    if x % 3 &#x3D;&#x3D; 0:        numbers.append(x*x)

而通过列表推导式一行代码就可以实现：

1numbers &#x3D; [x*x for x in xrange(20) if x % 3 &#x3D;&#x3D; 0]

列表推导式可以用于集合和字典，将[…] 变为[…]。集合和字典的实现如下所示：

集合：
1numbers &#x3D; &#123;x*x for x in range(0, 20) if x % 3 &#x3D;&#x3D; 0&#125;
字典：
1numbers &#x3D; &#123;x: x*x for x in range(0, 20) i ...</div></div></div><div class="recent-post-item"><div class="post_cover right_radius"><a href="/blog/2020/06/09/git%E6%95%99%E7%A8%8B/git%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4%E5%A4%A7%E5%85%A8/%E5%A6%82%E4%BD%95%E4%BC%98%E9%9B%85%E7%9A%84%E5%86%99%E5%87%BApython%E4%BB%A3%E7%A0%81/" title="如何优雅的写出python代码">     <img class="post_bg" src="/blog/img/%E5%A6%82%E4%BD%95%E4%BC%98%E9%9B%85%E7%9A%84%E5%86%99%E5%87%BApython%E4%BB%A3%E7%A0%81/%E5%A6%82%E4%BD%95%E4%BC%98%E9%9B%85%E7%9A%84%E5%86%99%E5%87%BApython%E4%BB%A3%E7%A0%81/index.png" onerror="this.onerror=null;this.src='/blog/img/404.jpg'" alt="如何优雅的写出python代码"></a></div><div class="recent-post-info"><a class="article-title" href="/blog/2020/06/09/git%E6%95%99%E7%A8%8B/git%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4%E5%A4%A7%E5%85%A8/%E5%A6%82%E4%BD%95%E4%BC%98%E9%9B%85%E7%9A%84%E5%86%99%E5%87%BApython%E4%BB%A3%E7%A0%81/" title="如何优雅的写出python代码">如何优雅的写出python代码</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-06-09T13:15:50.000Z" title="发表于 2020-06-09 21:15:50">2020-06-09</time></span></div><div class="content">1如何优美的书写python代码

变量值的交换1a, b &#x3D; b, a

列表推导式
列表推导式是java及C++等语言没有的特性，能够很简洁的实现for循环，可以应用列表，集合或者子字典。例如我们要求20以内的整除3的数的平方的列表，可以用如下代码实现：

1234numbers &#x3D; []for x in xrange(20):    if x % 3 &#x3D;&#x3D; 0:        numbers.append(x*x)

而通过列表推导式一行代码就可以实现：

1numbers &#x3D; [x*x for x in xrange(20) if x % 3 &#x3D;&#x3D; 0]

列表推导式可以用于集合和字典，将[…] 变为[…]。集合和字典的实现如下所示：

集合：
1numbers &#x3D; &#123;x*x for x in range(0, 20) if x % 3 &#x3D;&#x3D; 0&#125;
字典：
1numbers &#x3D; &#123;x: x*x for x in range(0, 20) i ...</div></div></div><div class="recent-post-item"><div class="post_cover left_radius"><a href="/blog/2020/06/09/%E6%B6%88%E6%81%AF%E9%98%9F%E5%88%97/kafka/" title="flask搭配kafka">     <img class="post_bg" src="/blog/img/%E5%A6%82%E4%BD%95%E4%BC%98%E9%9B%85%E7%9A%84%E5%86%99%E5%87%BApython%E4%BB%A3%E7%A0%81/%E5%A6%82%E4%BD%95%E4%BC%98%E9%9B%85%E7%9A%84%E5%86%99%E5%87%BApython%E4%BB%A3%E7%A0%81/index.png" onerror="this.onerror=null;this.src='/blog/img/404.jpg'" alt="flask搭配kafka"></a></div><div class="recent-post-info"><a class="article-title" href="/blog/2020/06/09/%E6%B6%88%E6%81%AF%E9%98%9F%E5%88%97/kafka/" title="flask搭配kafka">flask搭配kafka</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-06-09T13:15:50.000Z" title="发表于 2020-06-09 21:15:50">2020-06-09</time></span></div><div class="content">1python kafka 搭配flask web框架教程

引言
前几天做项目，需要用到kafka做消息队列，啥，kafka是啥玩意？我第一次听见这个名词也是一脸懵逼 那么啥是kafka

消息队列
Kafka是分布式发布-订阅消息系统，它最初是由LinkedIn公司开发的，之后成为Apache项目的一部分，Kafka是一个分布式，可划分的，冗余备份的持久性的日志服务，它主要用于处理流式数据。

为什么使用kafka消息系统？
kafka是一个分布式的消息系统,使用kafka具有以下几个优点


解耦
冗余
扩展性
灵活性 &amp; 峰值处理能力
顺序保证
缓冲

准备
研究了几天没有彻底研究透，所以只能发表一些浅见


首先要想用这个kafka做消息队列的话，你要了解python的多线程编程 我用的是python自带的 threading 框架


然后你要有一个服务器，在服务器配置好kafka


最后要有一颗认真钻研的心

初探kafka
第一次用kafka的时候先去看了看官方文档 ，英文实在是看不懂，用百度翻译一边看一边读，发现熟悉的太慢了，后来先用百度百度了几个kafka ...</div></div></div><div class="recent-post-item"><div class="post_cover right_radius"><a href="/blog/2020/04/04/css%E5%AD%A6%E4%B9%A0/%E5%B0%8F%E5%85%94%E5%AD%90/" title="css3备忘录">     <img class="post_bg" src="/blog/img/css%E5%AD%A6%E4%B9%A0/2.jpg" onerror="this.onerror=null;this.src='/blog/img/404.jpg'" alt="css3备忘录"></a></div><div class="recent-post-info"><a class="article-title" href="/blog/2020/04/04/css%E5%AD%A6%E4%B9%A0/%E5%B0%8F%E5%85%94%E5%AD%90/" title="css3备忘录">css3备忘录</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-04-04T06:47:06.000Z" title="发表于 2020-04-04 14:47:06">2020-04-04</time></span></div><div class="content">最终效果图先放最终效果图：
制作过程整个图像其实可以分为两个部分，一是蓝黑色的背景，二是这只往前跳的小兔子，背景可以直接在body里设置，因此我们的HTML主题部分就只需要下面一个div：
1&lt;div class&#x3D;&quot;rabbit&quot;&gt;&lt;&#x2F;div&gt;

接着CSS里开始设置样式，先是整体的背景：
1234567891011body &#123;    margin: 0;    height: 100vh;    display: flex;    align-items: center;    justify-content: center;    background: linear-gradient(midnightblue, black);    font-size: 20px;    margin-top: 2em;    overflow: hidden;&#125;
引申一点相关知识：上面的CSS代码里display：flex其实是弹性布局，采用Flex布局的元素，称为Flex容器（flex container）， ...</div></div></div><div class="recent-post-item"><div class="post_cover left_radius"><a href="/blog/2020/03/16/js%E7%9B%AE%E5%BD%95/%E5%8E%BB%E9%99%A4%E7%BD%91%E7%AB%99%E4%B8%8D%E8%83%BD%E5%8F%B3%E9%94%AE%E6%97%B6%E9%97%B4/" title="去除网站不能右键时间">     <img class="post_bg" src="/blog/img/opencv/opencv_split_img/opencv_split_img_style.jpg" onerror="this.onerror=null;this.src='/blog/img/404.jpg'" alt="去除网站不能右键时间"></a></div><div class="recent-post-info"><a class="article-title" href="/blog/2020/03/16/js%E7%9B%AE%E5%BD%95/%E5%8E%BB%E9%99%A4%E7%BD%91%E7%AB%99%E4%B8%8D%E8%83%BD%E5%8F%B3%E9%94%AE%E6%97%B6%E9%97%B4/" title="去除网站不能右键时间">去除网站不能右键时间</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-03-16T10:07:06.000Z" title="发表于 2020-03-16 18:07:06">2020-03-16</time></span></div><div class="content">
去除网站不能右键事件


F12打开控制台敲上

1document.oncontextmenu&#x3D;new Function(&quot;event.returnValue&#x3D;true;&quot;);document.onselectstart&#x3D;new Function(&quot;event.returnValue&#x3D;true;&quot;);
</div></div></div><div class="recent-post-item"><div class="post_cover right_radius"><a href="/blog/2020/01/28/%E6%9C%8D%E5%8A%A1%E5%99%A8%E8%BF%90%E7%BB%B4/%E7%AE%A1%E7%90%86python%E7%8E%AF%E5%A2%83/" title="管理python环境">     <img class="post_bg" src="/blog/img/%E6%9C%8D%E5%8A%A1%E5%99%A8%E8%BF%90%E7%BB%B4/linux%E5%91%BD%E4%BB%A4/theme.jpg" onerror="this.onerror=null;this.src='/blog/img/404.jpg'" alt="管理python环境"></a></div><div class="recent-post-info"><a class="article-title" href="/blog/2020/01/28/%E6%9C%8D%E5%8A%A1%E5%99%A8%E8%BF%90%E7%BB%B4/%E7%AE%A1%E7%90%86python%E7%8E%AF%E5%A2%83/" title="管理python环境">管理python环境</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-01-28T08:30:06.000Z" title="发表于 2020-01-28 16:30:06">2020-01-28</time></span></div><div class="content">virtualenvwindows
123进入虚拟环境spider_env\Scripts\activatesource scrapy_env&#x2F;bin&#x2F;activate
12345678910安装pip install virtualenv激活虚拟环境source my_project&#x2F;bin&#x2F;activate退出虚拟环境deactivate输出当前依赖包pip freeze &gt; requirements.txt安装依赖包$ pip install -r requirements.txt

virtualenvwrapper
12345678910111213141516171819202122# 安装$ pip install virtualenvwrapper# 修改~&#x2F;.zshrc$ cat ~&#x2F;.zshrcif [ -f &#x2F;usr&#x2F;local&#x2F;bin&#x2F;virtualenvwrapper.sh ]; then    export WORKON_HOME&#x3D;$HOME& ...</div></div></div><div class="recent-post-item"><div class="post_cover left_radius"><a href="/blog/2020/01/28/%E6%9C%8D%E5%8A%A1%E5%99%A8%E8%BF%90%E7%BB%B4/%E5%AE%9E%E9%AA%8C%E5%AE%A4%E8%BF%90%E7%BB%B4%E6%96%87%E6%A1%A3/" title="实验室运维文档">     <img class="post_bg" src="/blog/img/%E6%9C%8D%E5%8A%A1%E5%99%A8%E8%BF%90%E7%BB%B4/linux%E5%91%BD%E4%BB%A4/theme.jpg" onerror="this.onerror=null;this.src='/blog/img/404.jpg'" alt="实验室运维文档"></a></div><div class="recent-post-info"><a class="article-title" href="/blog/2020/01/28/%E6%9C%8D%E5%8A%A1%E5%99%A8%E8%BF%90%E7%BB%B4/%E5%AE%9E%E9%AA%8C%E5%AE%A4%E8%BF%90%E7%BB%B4%E6%96%87%E6%A1%A3/" title="实验室运维文档">实验室运维文档</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-01-28T08:30:06.000Z" title="发表于 2020-01-28 16:30:06">2020-01-28</time></span></div><div class="content">引言你是否因为python环境杂乱而苦恼，是否因为程序依赖库的半杯不一样而频繁卸载库，是否因为环境问题不停的切换目录等那么你看完这篇文件就能解决你的这些烦恼，小编来讲解linux下多个python环境应该怎么管理
1：工具安装virtualenv是python开发中一个重要的工具,它可以帮助我们创建一个干净的python解释环境，打开控制台安装virtualenv
1pip install virtualenv
2：创建不同python版本环境virtualenv创建python版本往往是系统默认的2.x版本.别急,我们只需要一条简单的命令就可以创建一个python3.x的虚拟环境
1virtualenv -p &#x2F;usr&#x2F;bin&#x2F;python3 name
/usr/bin/python3是linux系统中对python3版本建立的软连接路径，name就是我们的python环境的名称了，注意,前提是你已经安装了python3.x版本
3：进入环境激活虚拟环境，我们需要打开控制台移动到创建虚拟环境的文件夹下，执行命令
1source env_name&#x2F ...</div></div></div><div class="recent-post-item"><div class="post_cover right_radius"><a href="/blog/2020/01/16/css3%E5%A4%87%E5%BF%98%E5%BD%95/css3/" title="css3备忘录">     <img class="post_bg" src="/blog/img/%E6%9C%8D%E5%8A%A1%E5%99%A8%E8%BF%90%E7%BB%B4/nginx%E5%AE%89%E8%A3%85/theme.jpg" onerror="this.onerror=null;this.src='/blog/img/404.jpg'" alt="css3备忘录"></a></div><div class="recent-post-info"><a class="article-title" href="/blog/2020/01/16/css3%E5%A4%87%E5%BF%98%E5%BD%95/css3/" title="css3备忘录">css3备忘录</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-01-16T12:24:06.000Z" title="发表于 2020-01-16 20:24:06">2020-01-16</time></span></div><div class="content">内边框:
1box-sizing: border-box;
外边框:
1box-sizing: content-box;
div透明度:
1opacity:0.4;</div></div></div><div class="recent-post-item"><div class="post_cover left_radius"><a href="/blog/2020/01/16/scrapy%E5%AD%A6%E4%B9%A0/scrapy%E6%95%99%E7%A8%8B/" title="scrapy教程">     <img class="post_bg" src="/blog/img/opencv/opencv_split_img/opencv_split_img_style.jpg" onerror="this.onerror=null;this.src='/blog/img/404.jpg'" alt="scrapy教程"></a></div><div class="recent-post-info"><a class="article-title" href="/blog/2020/01/16/scrapy%E5%AD%A6%E4%B9%A0/scrapy%E6%95%99%E7%A8%8B/" title="scrapy教程">scrapy教程</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-01-16T12:24:06.000Z" title="发表于 2020-01-16 20:24:06">2020-01-16</time></span></div><div class="content">scrapy简单爬虫需要具备的知识1:python基本语法，包括类等
2:xpath或者css选择器语法
3:逻辑处理能力
教程目标站点http://lab.scrapyd.cn/
一：创建一个scrapy项目1:scrapy创建命令
命令控制台输入
1scrapy startproject scrapyd
scrapy startproject是固定命令 scrapyd是爬虫项目的名称用来启动爬虫的2：目录结构

scrapy.cfg：爬虫项目的配置文件。
init.py：爬虫项目的初始化文件，用来对项目做初始化工作。
items.py：爬虫项目的数据容器文件，用来定义要获取的数据。
pipelines.py：爬虫项目的管道文件，用来对items中的数据进行进一步的加工处理。
settings.py：爬虫项目的设置文件，包含了爬虫项目的设置信息。
middlewares.py：爬虫项目的中间件文件。
二：创建一个scrapy蜘蛛文件1：创建蜘蛛
1scrapy genspider mie lab.scrapyd.cn

这里我们已经成功创建了一个scrapy蜘蛛文件，我们把mie.p ...</div></div></div><div class="recent-post-item"><div class="post_cover right_radius"><a href="/blog/2020/01/16/%E6%95%B0%E6%8D%AE%E5%BA%93/PL/SQL/" title="PL/SQL">     <img class="post_bg" src="/blog/img/opencv/opencv_split_img/opencv_split_img_style.jpg" onerror="this.onerror=null;this.src='/blog/img/404.jpg'" alt="PL/SQL"></a></div><div class="recent-post-info"><a class="article-title" href="/blog/2020/01/16/%E6%95%B0%E6%8D%AE%E5%BA%93/PL/SQL/" title="PL/SQL">PL/SQL</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-01-16T12:24:06.000Z" title="发表于 2020-01-16 20:24:06">2020-01-16</time></span></div><div class="content">PL/SQL
declare

定义部分


begin

执行部分


exception

异常处理部分


end

结束部分输出1dbms_output.put_line(&#39;总人数&#39; || num)
替代变量
1:用于交互

123456begin    num :&#x3D; $num; &#x2F;&#x2F; 接收参数     select * into num from user &#x2F;&#x2F; 赋值    num :&#x3D; &#39;$num&#39; &#x2F;&#x2F;替代变量加单引号输入时不用输入&#39;&#39;
1234create or replace procedure update_emp(no number) is beginend;
声明变量必须在declare申明num varchar(10);常量关键字constantnum constant varchar(10) := ‘a’;



</div></div></div><nav id="pagination"><div class="pagination"><a class="extend prev" rel="prev" href="/blog/"><i class="fas fa-chevron-left fa-fw"></i></a><a class="page-number" href="/blog/">1</a><span class="page-number current">2</span><a class="page-number" href="/blog/page/3/">3</a><a class="extend next" rel="next" href="/blog/page/3/"><i class="fas fa-chevron-right fa-fw"></i></a></div></nav></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="card-info-avatar is-center"><img class="avatar-img" src="/blog/img/style/touxiang.jpg" onerror="this.onerror=null;this.src='/blog/img/friend_404.gif'" alt="avatar"/><div class="author-info__name">小魂</div><div class="author-info__description"></div></div><div class="card-info-data"><div class="card-info-data-item is-center"><a href="/blog/archives/"><div class="headline">文章</div><div class="length-num">26</div></a></div><div class="card-info-data-item is-center"><a href="/blog/tags/"><div class="headline">标签</div><div class="length-num">14</div></a></div></div><a class="button--animated" id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/xxxxxx"><i class="fab fa-github"></i><span>Follow Me</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://gitee.com/shangxiaohun/dashboard/projects" target="_blank" title="Github"><i class="fa fa-github"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn card-announcement-animation"></i><span>公告</span></div><div class="announcement_content">This is my Blog</div></div><div class="sticky_layout"><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/blog/2021/04/21/%E6%98%BE%E7%A4%BA%E5%99%A8/xianshiqi/" title="Linux开启显示器内置声卡"><img src="/blog/img/%E6%98%BE%E7%A4%BA%E5%99%A8/picture/index.png" onerror="this.onerror=null;this.src='/blog/img/404.jpg'" alt="Linux开启显示器内置声卡"/></a><div class="content"><a class="title" href="/blog/2021/04/21/%E6%98%BE%E7%A4%BA%E5%99%A8/xianshiqi/" title="Linux开启显示器内置声卡">Linux开启显示器内置声卡</a><time datetime="2021-04-21T05:08:50.000Z" title="发表于 2021-04-21 13:08:50">2021-04-21</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/blog/2021/02/09/%E6%95%99%E7%A8%8B/%E7%8E%AF%E5%A2%83%E5%87%86%E5%A4%87/" title="环境准备"><img src="/blog/img/%E5%A6%82%E4%BD%95%E4%BC%98%E9%9B%85%E7%9A%84%E5%86%99%E5%87%BApython%E4%BB%A3%E7%A0%81/%E5%A6%82%E4%BD%95%E4%BC%98%E9%9B%85%E7%9A%84%E5%86%99%E5%87%BApython%E4%BB%A3%E7%A0%81/index.png" onerror="this.onerror=null;this.src='/blog/img/404.jpg'" alt="环境准备"/></a><div class="content"><a class="title" href="/blog/2021/02/09/%E6%95%99%E7%A8%8B/%E7%8E%AF%E5%A2%83%E5%87%86%E5%A4%87/" title="环境准备">环境准备</a><time datetime="2021-02-09T02:59:50.000Z" title="发表于 2021-02-09 10:59:50">2021-02-09</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/blog/2021/02/07/%E6%95%99%E7%A8%8B/%E5%88%86%E6%9E%90%E5%BB%BA%E5%BA%93%E5%87%86%E5%A4%87%E5%B7%A5%E4%BD%9C/" title="分析建库准备工作"><img src="/blog/img/%E5%A6%82%E4%BD%95%E4%BC%98%E9%9B%85%E7%9A%84%E5%86%99%E5%87%BApython%E4%BB%A3%E7%A0%81/%E5%A6%82%E4%BD%95%E4%BC%98%E9%9B%85%E7%9A%84%E5%86%99%E5%87%BApython%E4%BB%A3%E7%A0%81/index.png" onerror="this.onerror=null;this.src='/blog/img/404.jpg'" alt="分析建库准备工作"/></a><div class="content"><a class="title" href="/blog/2021/02/07/%E6%95%99%E7%A8%8B/%E5%88%86%E6%9E%90%E5%BB%BA%E5%BA%93%E5%87%86%E5%A4%87%E5%B7%A5%E4%BD%9C/" title="分析建库准备工作">分析建库准备工作</a><time datetime="2021-02-07T08:15:50.000Z" title="发表于 2021-02-07 16:15:50">2021-02-07</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/blog/2020/09/27/%E9%80%81%E7%BB%99%E5%B0%8F%E5%AD%A6%E5%BC%9F%E7%9A%84%E4%B8%80%E5%B0%81%E4%BF%A1/%E9%80%81%E7%BB%99%E5%B0%8F%E5%AD%A6%E5%BC%9F%E7%9A%84%E4%B8%80%E5%B0%81%E4%BF%A1/" title="送给小学弟的一封信"><img src="/blog/img/%E5%A6%82%E4%BD%95%E4%BC%98%E9%9B%85%E7%9A%84%E5%86%99%E5%87%BApython%E4%BB%A3%E7%A0%81/%E5%A6%82%E4%BD%95%E4%BC%98%E9%9B%85%E7%9A%84%E5%86%99%E5%87%BApython%E4%BB%A3%E7%A0%81/index.png" onerror="this.onerror=null;this.src='/blog/img/404.jpg'" alt="送给小学弟的一封信"/></a><div class="content"><a class="title" href="/blog/2020/09/27/%E9%80%81%E7%BB%99%E5%B0%8F%E5%AD%A6%E5%BC%9F%E7%9A%84%E4%B8%80%E5%B0%81%E4%BF%A1/%E9%80%81%E7%BB%99%E5%B0%8F%E5%AD%A6%E5%BC%9F%E7%9A%84%E4%B8%80%E5%B0%81%E4%BF%A1/" title="送给小学弟的一封信">送给小学弟的一封信</a><time datetime="2020-09-26T18:20:50.000Z" title="发表于 2020-09-27 02:20:50">2020-09-27</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/blog/2020/07/11/%E5%82%85%E7%AB%8B%E5%8F%B6%E5%8F%98%E6%8D%A2/%E5%82%85%E7%AB%8B%E5%8F%B6%E5%8F%98%E6%8D%A2/" title="傅立叶变换"><img src="/blog/img/opencv/opencv_split_img/opencv_split_img_style.jpg" onerror="this.onerror=null;this.src='/blog/img/404.jpg'" alt="傅立叶变换"/></a><div class="content"><a class="title" href="/blog/2020/07/11/%E5%82%85%E7%AB%8B%E5%8F%B6%E5%8F%98%E6%8D%A2/%E5%82%85%E7%AB%8B%E5%8F%B6%E5%8F%98%E6%8D%A2/" title="傅立叶变换">傅立叶变换</a><time datetime="2020-07-11T15:53:50.000Z" title="发表于 2020-07-11 23:53:50">2020-07-11</time></div></div></div></div><div class="card-widget card-tags"><div class="item-headline"><i class="fas fa-tags"></i><span>标签</span></div><div class="card-tag-cloud"><a href="/blog/tags/FastApi/" style="font-size: 1.23em; color: #999ea6">FastApi</a> <a href="/blog/tags/Linux/" style="font-size: 1.1em; color: #999">Linux</a> <a href="/blog/tags/css3/" style="font-size: 1.23em; color: #999ea6">css3</a> <a href="/blog/tags/django-study/" style="font-size: 1.1em; color: #999">django_study</a> <a href="/blog/tags/git/" style="font-size: 1.23em; color: #999ea6">git</a> <a href="/blog/tags/js/" style="font-size: 1.1em; color: #999">js</a> <a href="/blog/tags/kafka/" style="font-size: 1.23em; color: #999ea6">kafka</a> <a href="/blog/tags/mysql/" style="font-size: 1.1em; color: #999">mysql</a> <a href="/blog/tags/opencv/" style="font-size: 1.1em; color: #999">opencv</a> <a href="/blog/tags/python/" style="font-size: 1.37em; color: #99a4b2">python</a> <a href="/blog/tags/scrapy/" style="font-size: 1.1em; color: #999">scrapy</a> <a href="/blog/tags/teamviewer/" style="font-size: 1.1em; color: #999">teamviewer</a> <a href="/blog/tags/%E5%82%85%E7%AB%8B%E5%8F%B6/" style="font-size: 1.1em; color: #999">傅立叶</a> <a href="/blog/tags/%E6%9C%8D%E5%8A%A1%E5%99%A8/" style="font-size: 1.5em; color: #99a9bf">服务器</a></div></div><div class="card-widget card-archives"><div class="item-headline"><i class="fas fa-archive"></i><span>归档</span><a class="card-more-btn" href="/blog/archives/" title="查看更多">
    <i class="fas fa-angle-right"></i></a></div><ul class="card-archive-list"><li class="card-archive-list-item"><a class="card-archive-list-link" href="/blog/archives/2021/04/"><span class="card-archive-list-date">四月 2021</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/blog/archives/2021/02/"><span class="card-archive-list-date">二月 2021</span><span class="card-archive-list-count">2</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/blog/archives/2020/09/"><span class="card-archive-list-date">九月 2020</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/blog/archives/2020/07/"><span class="card-archive-list-date">七月 2020</span><span class="card-archive-list-count">2</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/blog/archives/2020/06/"><span class="card-archive-list-date">六月 2020</span><span class="card-archive-list-count">7</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/blog/archives/2020/04/"><span class="card-archive-list-date">四月 2020</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/blog/archives/2020/03/"><span class="card-archive-list-date">三月 2020</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/blog/archives/2020/01/"><span class="card-archive-list-date">一月 2020</span><span class="card-archive-list-count">5</span></a></li></ul></div><div class="card-widget card-webinfo"><div class="item-headline"><i class="fas fa-chart-line"></i><span>网站资讯</span></div><div class="webinfo"><div class="webinfo-item"><div class="item-name">文章数目 :</div><div class="item-count">26</div></div><div class="webinfo-item"><div class="item-name">本站访客数 :</div><div class="item-count" id="busuanzi_value_site_uv"></div></div><div class="webinfo-item"><div class="item-name">本站总访问量 :</div><div class="item-count" id="busuanzi_value_site_pv"></div></div><div class="webinfo-item"><div class="item-name">最后更新时间 :</div><div class="item-count" id="last-push-date" data-lastPushDate="2021-04-21T05:41:10.265Z"></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2020 - 2021 By 小魂</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div><div class="footer_custom_text">你只管努力，剩下的交给时间</div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/blog/js/utils.js"></script><script src="/blog/js/main.js"></script><div class="js-pjax"></div><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></body></html>